package com.example.demo.controller;

import com.example.demo.ao.HomeDetailsAo;
import com.example.demo.service.HomeDetailsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/HomeDetailsController")
@Slf4j
public class HomeDetailsController {


    @Autowired
    private HomeDetailsService homeDetailsService;

    @PostMapping("/updateInfo")
    public int updateInfo(@RequestBody List<HomeDetailsAo> homeDetailsAo) {
        return homeDetailsService.updateInfo(homeDetailsAo);
    }

    @PostMapping("/insertInfo")
    public int insertInfo(@RequestBody List<HomeDetailsAo> homeDetailsAo) {
        return homeDetailsService.insertInfo(homeDetailsAo);
    }
}
